<?php
include_once '../tools/DbTools.php';
$token = $_COOKIE['Token'];
session_start();
$username = $_SESSION[$token]['uesrname'];
$password = $_SESSION[$token]['password'];
//初始化数据库连接
DbTools::InitDb();
//$sql = "select * from bankcard where CardNo='$username' and CardPwd='$password'";
$sql = "select *,(select RealName from accountinfo where accountinfo.AccountId=bankcard.AccountId) RealName
from bankcard where CardNo='$username' and CardPwd='$password'";
//获取数据
$result = DbTools::select($sql);
//关闭连接
DbTools::close();
$CardMoney = $result[0]['CardMoney'];

?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>用户中心</title>
</head>
<body>
<form action="moneyInAction.php" method="post">
    当前余额：<input type="text" name="" id="" value="<?php echo $CardMoney ?>" readonly="readonly" disabled="disabled" /><br />
    存钱金额：<input type="text" name="moneyIn" id="money" value="" />
    <br />
    <input type="submit" value="提交"/>
</form>
<a href="../user/userInfo.php">回到用户中心</a>
</body>
</html>
